package cn.tedu.egweibo1.base.response;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class json
{
    private Integer state;
    private String message;
    private Object data;
    public json(code code, Object data)
    {
        this.state=code.getState();
        this.message=code.getMessage();
        this.data=data;
    }
    public json(code code)
    {
        this.state=code.getState();
        this.message=code.getMessage();
        this.data=null;
    }
    public static json success()
    {
        return new json(code.SUCCESS);
    }
    public static json success(Object data)
    {
        return new json(code.SUCCESS,data);
    }
}
